package cn.cjyll.test;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;

import org.junit.Test;

import cn.cjyll.C3P0DataSoure.JDBCUtilsC3P0;

public class testadmin {

	@Test
	public void fun1() throws SQLException
	{
		Connection con = JDBCUtilsC3P0.getConnection();
		String sql = "select username,password from admin";
		PreparedStatement ps = con.prepareStatement(sql);
		ResultSet res = ps.executeQuery();
		while(res.next())
		{
			System.out.println(res.getString("username") + res.getString("password"));
		}
		
		 Connection con1 = JDBCUtilsC3P0.getConnection();
		    String sq1l = "SELECT nr FROM gg;";
		    Statement sta = con.createStatement();
		    ResultSet res1 = sta.executeQuery(sq1l);
	}
}
